﻿using System;
using System.ComponentModel;
using System.Runtime.Serialization;


namespace SharpGL.SceneGraph
{
    /// <summary>
    /// The Scene Container is the top-level object in a scene graph.
    /// </summary>
    [TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
    [DataContract(/*IsReference = true, */Name = "SceneContainer", Namespace = "SharpGL.SceneGraph")]
    public class SceneContainer : SceneElement
    {
        #region Private Consts

        private static readonly string defaultName = "Scene Container";

        #endregion Private Consts

        #region Public Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="SceneContainer"/> class.
        /// </summary>
        public SceneContainer()
        {
            Name = defaultName;
        }

        #endregion Public Constructors

        #region Public Properties

        /// <summary>
        /// Gets the parent.
        /// </summary>
        [Description("The parent scene element."), Category("Scene Container")]
        public new SceneElement Parent
        {
            get
            {
                return null;
            }
            protected set
            {
                if (value != null)
                    throw new Exception("Scene container '" + Name + "' can't have a parent.");
            }
        }

        #endregion Public Properties
    }
}